import { post } from '../http'
import store from '@/store'

//班列基础信息

//查询
export const GetClassColumnModelList=({
  PageIndex,PageSize,tbbTrain,tbbOriginstation,tbbFinishstation
})=>{
  return post('/FTKJWLHYPT/Plan/GetClassColumnModelList',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          tbbEptId:store.state.user.FLT_UUID_DX_H,
          tbbTrain,
          tbbOriginstation,
          tbbFinishstation
        }
      },
      Orderby: {},
      PageIndex: {
        FTKJWLHYPT: PageIndex
      },
      PageSize: {
        FTKJWLHYPT: PageSize
      }
    }
  })
}

//新增班列基础信息
export const AddClassColumn=({
  tbbTrain,//车次
  tbbLoadtrain,//装车组织站
  tbbOriginstation,//始发站
  tbbOrigincity,//始发城市
  tbbFinishstation,//终点站
  tbbFinishcity,//终点城市
  tbbSpeed,//速度标尺(千米/时)
  tbbOpencycle,//开行周期(列/周)
  tbbMincompiled,//最小编成量数
  tbbMaxcompiled,//最大编成量数
  tbbGroupcontent,//编组内容
  tbbRemark,//备注
  tbbLoadtraindbm,//装车组织站电报码
  tbbOriginstationdbm,//始发站电报码
  tbbFinishstationdbm,//终点站电报码
  tbbType,//班列类型 code=BLLX
  tbbTrainName,//列车名
  tbbUpdown,//上下行标记 RV_DOMAIN=上下行标记
  tbbOperationhours,//运行时间(小时)
  tbbFreightmileage,//铁路货运里程(公里)
})=>{
  return post('/FTKJWLHYPT/Plan/AddClassColumn',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          tbbEptId:store.state.user.FLT_UUID_DX_H,
          tbbInsertuser:store.state.user.USR_CODE_DX_H,
          tbbTrain,
          tbbLoadtrain,
          tbbOriginstation,
          tbbOrigincity,
          tbbFinishstation,
          tbbFinishcity,
          tbbSpeed:Number(tbbSpeed),
          tbbOpencycle:Number(tbbOpencycle),
          tbbMincompiled:Number(tbbMincompiled),
          tbbMaxcompiled:Number(tbbMaxcompiled),
          tbbGroupcontent,
          tbbRemark,
          tbbLoadtraindbm,
          tbbOriginstationdbm,
          tbbFinishstationdbm,
          tbbType,
          tbbTrainName,
          tbbUpdown,
          tbbOperationhours,
          tbbFreightmileage
        }
      }
    }
  })
}

//编辑
export const EditClassColumn=({
  tbbTrain,//车次
  tbbId,
  tbbLoadtrain,//装车组织站
  tbbOriginstation,//始发站
  tbbOrigincity,//始发城市
  tbbFinishstation,//终点站
  tbbFinishcity,//终点城市
  tbbSpeed,//速度标尺(千米/时)
  tbbOpencycle,//开行周期(列/周)
  tbbMincompiled,//最小编成量数
  tbbMaxcompiled,//最大编成量数
  tbbGroupcontent,//编组内容
  tbbRemark,//备注
  tbbLoadtraindbm,//装车组织站电报码
  tbbOriginstationdbm,//始发站电报码
  tbbFinishstationdbm,//终点站电报码
  tbbType,//班列类型 code=BLLX
  tbbTrainName,//列车名
  tbbUpdown,//上下行标记 RV_DOMAIN=上下行标记
  tbbOperationhours,//运行时间(小时)
  tbbFreightmileage,//铁路货运里程(公里)
})=>{
  return post('/FTKJWLHYPT/Plan/EditClassColumn',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          tbbEptId:store.state.user.FLT_UUID_DX_H,
          tbbLstupduser:store.state.user.USR_CODE_DX_H,
          tbbId,
          tbbTrain,
          tbbLoadtrain,
          tbbOriginstation,
          tbbOrigincity,
          tbbFinishstation,
          tbbFinishcity,
          tbbSpeed:Number(tbbSpeed),
          tbbOpencycle:Number(tbbOpencycle),
          tbbMincompiled:Number(tbbMincompiled),
          tbbMaxcompiled:Number(tbbMaxcompiled),
          tbbGroupcontent,
          tbbRemark,
          tbbLoadtraindbm,
          tbbOriginstationdbm,
          tbbFinishstationdbm,
          tbbType,
          tbbTrainName,
          tbbUpdown,
          tbbOperationhours,
          tbbFreightmileage
        }
      }
    }
  })
}

//删除
export const DeleteClassColumn=({tbbId})=>{
  return post('/FTKJWLHYPT/Plan/DeleteClassColumn',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          tbbId:Number(tbbId)
        }
      }
    }
  })
}
